import React, { Component } from 'react';

// 子组件
export class Child2 extends Component {
  render() {
    // console.log('子', this.props);
    return (
      <div className="child">
        子2
        <button onClick={() => this.props.setMsg('子2挨打了')}>挨打了</button>
      </div>
    );
  }
}
